package sampleclass

import scala.util.Random

case class SubmitTask(var id: String, var name: String){
  println(">>>>>>>>>>>>")
  var sex = "nan"
  println(s"sex : $sex")
}
case class HeartBeat(time: Long){
  println("time:::" + time)
}
case object CheckTimeOutTask{
  val name ="yu"
  def m1=name
}


object CaseDemo04 extends App{
  val arr = Array(CheckTimeOutTask, HeartBeat(12333), SubmitTask("0001", "task-0001"))

  println("MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM")
  arr(Random.nextInt(arr.length)) match {
    case SubmitTask(para1, para2) => {
      println(s"$para1, $para2")
    }
    case HeartBeat(t) => {
      println(t)
    }
    case CheckTimeOutTask => {
      println("check")
    }
  }
}

